{
    "ServiceSettings": {
        "ListenAddress": "<%= @service_address %>:<%= @service_port %>",
        "MaximumLoginAttempts": <%= @service_maximum_login_attempts %>,
        "SegmentDeveloperKey": "<%= @service_segment_developer_key %>",
        "GoogleDeveloperKey": "<%= @service_google_developer_key %>",
        "EnableOAuthServiceProvider": <%= @service_enable_oauth_service_provider %>,
        "EnableIncomingWebhooks": <%= @service_enable_incoming_webhooks %>,
        "EnableOutgoingWebhooks": <%= @service_enable_outgoing_webhooks %>,
        "EnableCommands": <%= @service_enable_commands %>,
        "EnableOnlyAdminIntegrations": <%= @service_enable_only_admin_integrations %>,
        "EnablePostUsernameOverride": <%= @service_enable_post_username_override %>,
        "EnablePostIconOverride": <%= @service_enable_post_icon_override %>,
        "EnableTesting": <%= @service_enable_testing %>,
        "EnableSecurityFixAlert": <%= @service_enable_security_fix_alert %>,
        "EnableInsecureOutgoingConnections":  <%= @service_enable_insecure_outgoing_connections %>,
        "AllowCorsFrom":  "<%= @service_allow_cors_from %>",
        "EnableDeveloper": <%= @service_enable_developer %>,
        "SessionLengthWebInDays" : <%= @service_session_length_web_in_days %>,
        "SessionLengthMobileInDays" : <%= @service_session_length_mobile_in_days %>,
        "SessionLengthSSOInDays" : <%= @service_session_length_sso_in_days %>,
        "SessionCacheInMinutes" : <%= @service_session_cache_in_minutes %>
    },
    "TeamSettings": {
        "SiteName": "<%= @team_site_name %>",
        "MaxUsersPerTeam": <%= @team_max_users_per_team %>,
        "EnableTeamCreation": <%= @team_enable_team_creation %>,
        "EnableUserCreation": <%= @team_enable_user_creation %>,
        "RestrictCreationToDomains": "<%= @team_restrict_creation_to_domains %>",
        "RestrictTeamNames": <%= @team_restrict_team_names %>,
        "EnableTeamListing": <%= @team_enable_team_listing %>
    },
    "SqlSettings": {
        "DriverName": "<%= @sql_driver_name %>",
        "DataSource": "<%= @sql_data_source %>",
        "DataSourceReplicas": [<%= @sql_data_source_replicas.map{ |dsr| "\"#{dsr}\"" }.join(',') %>],
        "MaxIdleConns": <%= @sql_max_idle_conns %>,
        "MaxOpenConns": <%= @sql_max_open_conns %>,
        "Trace": <%= @sql_trace %>,
        "AtRestEncryptKey": "<%= @sql_at_rest_encrypt_key %>"
    },
    "LogSettings": {
        "ConsoleEnable": <%= @log_console_enable %>,
        "ConsoleLevel": "<%= @log_console_level %>",
        "EnableFile": <%= @log_enable_file %>,
        "FileLevel": "<%= @log_file_level %>",
        "FileFormat": "<%= @log_file_format %>",
        "FileLocation": "<%= @log_file_directory %>/mattermost.log"
    },
    "FileSettings": {
        "DriverName": "<%= @file_driver_name %>",
        "Directory": "<%= @file_directory %>",
        "EnablePublicLink": <%= @file_enable_public_link %>,
        "PublicLinkSalt": "<%= @file_public_link_salt %>",
        "ThumbnailWidth": <%= @file_thumbnail_width %>,
        "ThumbnailHeight": <%= @file_thumbnail_height %>,
        "PreviewWidth": <%= @file_preview_width %>,
        "PreviewHeight": <%= @file_preview_height %>,
        "ProfileWidth": <%= @file_profile_width %>,
        "ProfileHeight": <%= @file_profile_height %>,
        "InitialFont": "<%= @file_initial_font %>",
        "AmazonS3AccessKeyId": "<%= @file_amazon_s3_access_key_id %>",
        "AmazonS3SecretAccessKey": "<%= @file_amazon_s3_secret_access_key %>",
        "AmazonS3Bucket": "<%= @file_amazon_s3_bucket %>",
        "AmazonS3Region": "<%= @file_amazon_s3_region %>",
        "AmazonS3Endpoint": "<%= @file_amazon_s3_endpoint %>",
        "AmazonS3BucketEndpoint": "<%= @file_amazon_s3_bucket_endpoint %>",
        "AmazonS3LocationConstraint": <%= @file_amazon_s3_location_constraint %>,
        "AmazonS3LowercaseBucket": <%= @file_amazon_s3_lowercase_bucket %>
    },
    "EmailSettings": {
        "EnableSignUpWithEmail" : <%= @email_enable_sign_up_with_email %>,
        "EnableSignInWithEmail": <%= @email_enable_sign_in_with_email %>,
        "EnableSignInWithUsername": <%= @email_enable_sign_in_with_username %>,
        "SendEmailNotifications": <%= @email_send_email_notifications %>,
        "RequireEmailVerification": <%= @email_require_email_verification %>,
        "SMTPUsername": "<%= @email_smtp_username %>",
        "SMTPPassword": "<%= @email_smtp_password %>",
        "SMTPServer": "<%= @email_smtp_server %>",
        "SMTPPort": "<%= @email_smtp_port %>",
        "ConnectionSecurity": "<%= @email_connection_security %>",
        "InviteSalt": "<%= @email_invite_salt %>",
        "PasswordResetSalt": "<%= @email_password_reset_salt %>",
        "FeedbackName": "<%= @email_feedback_name %>",
        "FeedbackEmail": "<%= @email_feedback_email %>",
        "SendPushNotifications": <%= @email_send_push_notifications %>,
        "PushNotificationServer": "<%= @email_push_notification_server %>"
    },
    "RateLimitSettings": {
        "EnableRateLimiter": <%= @ratelimit_enable_rate_limiter %>,
        "PerSec": <%= @ratelimit_per_sec %>,
        "MemoryStoreSize": <%= @ratelimit_memory_store_size %>,
        "VaryByRemoteAddr": <%= @ratelimit_vary_by_remote_addr %>,
        "VaryByHeader": "<%= @ratelimit_vary_by_header %>"
    },
    "PrivacySettings": {
        "ShowEmailAddress": <%= @privacy_show_email_address %>,
        "ShowFullName": <%= @privacy_show_full_name %>
    },
    "SupportSettings": {
        "TermsOfServiceLink": "<%= @support_terms_of_service_link %>",
        "PrivacyPolicyLink": "<%= @support_privacy_policy_link %>",
        "AboutLink": "<%= @support_about_link %>",
        "HelpLink": "<%= @support_help_link %>",
        "ReportAProblemLink": "<%= @support_report_a_problem_link %>",
        "SupportEmail": "<%= @support_email %>"
    },
    "GitLabSettings": {
        "Enable": <%= @gitlab_enable %>,
        "Secret": "<%= @gitlab_secret %>",
        "Id": "<%= @gitlab_id %>",
        "Scope": "<%= @gitlab_scope %>",
        "AuthEndpoint": "<%= @gitlab_auth_endpoint %>",
        "TokenEndpoint": "<%= @gitlab_token_endpoint %>",
        "UserApiEndpoint": "<%= @gitlab_user_api_endpoint %>"
    }
}
